#pragma once

struct PCAPCapture {
	unsigned char	pBufferH264[1000000];
	int				BufferH264Len;
	int				H264Len;
	int				SecondFramePos;
};

struct Drawer {
	HDC		hdcscr;
	int		width;
	int		height;
	HBITMAP	hbmp;

	void*	pbmpdata;
	int		pbmplinesize[4];
};


// VideoFrameView

class VideoFrameView : public CWnd
{
	DECLARE_DYNAMIC(VideoFrameView)

public:
	AVCodec			*m_pCodecDecode;
	AVCodecContext	*m_pCtxDecode; 
	AVFrame			*m_pPictureDecoded;
	SwsContext		*m_pSwscale_context;

	PCAPCapture		m_pcapCapture;
	Drawer			m_drawer;

	char*	m_pFileName;

public:
	VideoFrameView();
	virtual ~VideoFrameView();

	void PreParation(HDC _hdc);
	void RunningThread(char* pFileName);

protected:

	DECLARE_MESSAGE_MAP()
};


